package breakout2014;

import com.jme3.input.InputManager;
import com.jme3.math.FastMath;
import com.jme3.math.Vector2f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.control.AbstractControl;


public class RacketControl extends AbstractControl {
    private int screenWidth, screenHeight;
//    is the player currently moving?
    public boolean left,right;
//    speed of the player
    private float speed = 800f;
//    lastRotation of the player
    private float lastRotation;
    private InputManager mouseManager;
    
    public RacketControl(int width, int height, InputManager mouseManager) {
        this.screenWidth = width;
        this.screenHeight = height;
        this.mouseManager = mouseManager;
    }
    
    @Override
    protected void controlUpdate(float tpf) {
         Vector2f mousePos = mouseManager.getCursorPosition();
         spatial.setLocalTranslation(mousePos.x, 10, 0);
    }

    @Override
    protected void controlRender(RenderManager rm, ViewPort vp) {}
    
//    reset the moving values (i.e. for spawning)
    public void reset() {
        
        left = false;
        right = false;
    }
}
